<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
	<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
	<title>添加栏目</title>
	<hdjs />
	<js file="__PUBLIC__/Js/mod.category.js" />
	<css file="__PUBLIC__/Css/mod.base.css" />
</head>
<body>
	<form action="" method="post" enctype='multipart/form-data' class='hd-form'>
		<div class="wrap">
			<div class="menu_list">
				<ul>
					<li>
						<a href="{:U('Category/index')}" >
							栏目列表
						</a>
					</li>
					<li>
						<a href="javascript:;" class="action">
							添加顶级栏目
						</a>
					</li>
					<li>
						<a href="{:U('Category/update_cache')}">
							更新栏目缓存
						</a>
					</li>
				</ul>
			</div>
			<div class="tab">
				<ul class="tab_menu">
					<li lab='base'><a href="#">基本配置</a></li>
					<li lab='view'><a href="#">模板配置</a></li>
				</ul>
				<div class="tab_content">
					<div id='base'>
						<table class='table2'>
							<tbody>
								<tr>
									<td>模型</td>
									<td>

										<if condition="isset($parent)">
											<input type="hidden" name="model_mid" value="{$parent.model_mid}" />
											{$parent.model}
										<else />
										<select name="model_mid">
											<!-- <option value="0">请选择模型</option> -->
											<foreach name="model" item='v'>
												<option  value="{$v.mid}">{$v.remark}</option>
											</foreach>
										</select>
										</if>
									</td>
								</tr>
								<tr>
									<td>文档类型</td>
									<td>
				
										<select name="type_typeid">
											<option value="0">请选择文档类型</option>
											<foreach name="type" item='v'>
												<option  value="{$v.typeid}" <if condition="isset($parent['type_typeid'])&& $v['typeid'] eq $parent['type_typeid']">selected="selected"</if>>{$v.typename}</option>
											</foreach>
										</select>
									
									</td>
								</tr>
								<tr>
									<td class="w100">上级分类</td>
									<td>
										<if condition="isset($parent)">
											<input type="hidden" name="pid" value="{$parent.cid}" />
											{$parent.cname}
										<else />
										<select name="pid" >
											<option value="0">一级分类</option>
											<foreach name='category' item='v'>
												<option value="{$v.cid}">{$v._name}</option>
											</foreach>
										</select>
										</if>
									</td>
								</tr>
								<tr>
									<td class="w100">分类名称</td>
									<td>
										<input type="text" name="cname"  class='w200'/>
									</td>
								</tr>
								
							
								<tr >
									<td>栏目图片</td>
									<td>
										<input type="file" name='pic'/>
									</td>
								</tr>
								

								<tr>
									<td>分类关键字</td>
									<td>
										<textarea name="keywords" class='w500 h100'></textarea>
									</td>
								</tr>
								
								
								
								<tr>
									<td>分类描述</td>
									<td>
										<textarea name="description" class='w500 h100'></textarea>
									</td>
								</tr>
								
								
								<tr>
									<td>分类排序</td>
									<td>
										<input name="sort" type="text" class='w200' value="100" />
									</td>
								</tr>
								

							</tbody>
						</table>
					</div>
					<div id='view'>
						<table class='table2 hd-form'>
							<tbody>
								<tr>
									<td>每页记录数</td>
									<td>
										<input name="page" type="text" class='w200' value="<if condition="isset($parent['page'])">{$parent.page}<else/>20</if>" />
									</td>
								</tr>
								<tr>
									<td>栏目类型</td>
									<td>
										<label>
											<input <if condition="!isset($parent['cat_type'])||1 eq $parent['cat_type']">checked="checked"</if>   type="radio" name="cat_type" value="1"/>	
											<span>普通</span>
										</label>
										<label>
											<input <if condition="isset($parent['cat_type'])&&2 eq $parent['cat_type']">checked="checked"</if> type="radio" name="cat_type" value="2"/>	
											<span>封面</span>
										</label>
										<label>
											<input <if condition="isset($parent['cat_type'])&&3 eq $parent['cat_type']">checked="checked"</if> type="radio" name="cat_type" value="3"/>	
											<span>跳转</span>
										</label>
										<label>
											<input <if condition="isset($parent['cat_type'])&&4 eq $parent['cat_type']">checked="checked"</if> type="radio" name="cat_type" value="4"/>	
											<span>单页</span>
										</label>
									</td>
								</tr>
								<tr>
									<td>跳转地址</td>
									<td>
										<input name="go_url" type="text" class='w200' value="" />
									</td>
								</tr>
								<tr>
									<td>跳转到子栏目</td>
									<td>
										<label>
											<input <if condition="!isset($parent['go_child'])||0 eq $parent['go_child']">checked="checked"</if>   type="radio" name="go_child" value="0"/>	
											<span>否</span>
										</label>
										<label>
											<input <if condition="isset($parent['go_child'])&&1 eq $parent['go_child']">checked="checked"</if> type="radio" name="go_child" value="1"/>	
											<span>是</span>
										</label>
									</td>
								</tr>
							<tr>
									<td>打开方式</td>
									<td>
										<label>
											<input <if condition="!isset($parent['target'])||1 eq $parent['target']">checked="checked"</if>   type="radio" name="target" value="1"/>	
											<span>当前窗口</span>
										</label>
										<label>
											<input <if condition="isset($parent['target'])&&2 eq $parent['target']">checked="checked"</if> type="radio" name="target" value="2"/>	
											<span>新窗口</span>
										</label>
									</td>
								</tr>

							<tr>
								<td class='w100'>封面模板</td>
								<td><input  class='w200' type="text" name='default_tpl' value="<if condition="isset($parent['default_tpl'])">{$parent.default_tpl}<else/>default</if>"/></td>
							</tr>
							<tr>
								<td>列表模板</td>
								<td><input  class='w200' type="text" name='list_tpl' value="<if condition="isset($parent['list_tpl'])">{$parent.list_tpl}<else/>lists</if>"/></td>
							</tr>
							<tr>
								<td>详细模板</td>
								<td><input  class='w200' type="text" name='view_tpl' value="<if condition="isset($parent['view_tpl'])">{$parent.view_tpl}<else/>view</if>"/></td>
							</tr>
							<tr>
								<td>控制器</td>
								<td><input  class='w200' type="text" name='remark' value="<if condition="isset($parent['remark'])">{$parent.remark}<else/>Index</if>"/></td>
							</tr>
							</tbody>
						</table>
					</div>
				</div>
			</div>
		</div>
		<div class="position-bottom">
			<input type="submit" class='hd-success' value="添加" />
			<input type="button" class="hd-cancel" onclick="location.href='{:U('Category/index')}'" value="返回"/>	
		</div>
	</form>
</body>
</html>